<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div></div>

  <script src="../../assets/libs/art-template/template-web.js"></script>

  <script id="my-template" type="text/html">
    {{ if score < 60 }}
    <p>不及格</p>
    {{ else if score < 100 }}
    <p>及格</p>
    {{ else }}
    <p>满分</p>
    {{ /if }}
  </script>

  <script>
    const data = {
      score: 100
    }

    const htmlStr = template('my-template', data)

    document.querySelector('div').innerHTML = htmlStr
  </script>
</body>

</html>